package com.frame.common;

import java.io.File;

import com.frame.pageform.ConfigFactory;



public class SystemConfig {

	private String title;
	private String rootPath;
	private String contextPath;
	private boolean loginCheckNumber;

	public static SystemConfig getInstance(){
		try
		{
			return (SystemConfig)ConfigFactory.getBean(SystemConfig.class);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return null;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getRootPath() {
		return rootPath;
	}

	public void setRootPath(String rootPath) {
		this.rootPath = rootPath;
	}

	public String getContextPath() {
		return contextPath;
	}

	public void setContextPath(String contextPath) {
		this.contextPath = contextPath;
	}

	public boolean isLoginCheckNumber() {
		return loginCheckNumber;
	}

	public void setLoginCheckNumber(boolean loginCheckNumber) {
		this.loginCheckNumber = loginCheckNumber;
	}
	public String getUploadPath(){
		return "/uploadfile";
	}
	public String getTempPath(){
		File file=new File(getRootPath()+"/temp");
		if(!file.exists())file.mkdir();
		return "/temp";
	}
}
